home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEV / A-B / 002. TESample.cpt / TESample.a < prev    next >
Text File  |  1988-08-01  |  3KB  |  80 lines

  1. ;
  2. ;    Apple Macintosh Developer Technical Support
  3. ;
  4. ;    MultiFinder-Aware TextEdit Sample Application
  5. ;
  6. ;    TESample
  7. ;
  8. ;    TESample.a    -    Assembler Source
  9. ;
  10. ;    Copyright © 1988 Apple Computer, Inc.
  11. ;    All rights reserved.
  12. ;
  13. ;    Versions:    1.0                    8/88
  14. ;
  15. ;    Components:    TESample.p            August 1, 1988
  16. ;                TESample.c            August 1, 1988
  17. ;                TESample.a            August 1, 1988
  18. ;                TESample.r            August 1, 1988
  19. ;                TESample.h            August 1, 1988
  20. ;                PTESample.make        August 1, 1988
  21. ;                CTESample.make        August 1, 1988
  22. ;
  23. ;    TESample is an example application that demonstrates how 
  24. ;    to initialize the commonly used toolbox managers, operate 
  25. ;    successfully under MultiFinder, handle desk accessories and 
  26. ;    create, grow, and zoom windows. The fundamental TextEdit 
  27. ;    toolbox calls and TextEdit autoscroll are demonstrated. It 
  28. ;    also shows how to create and maintain scrollbar controls.
  29. ;
  30. ;    It does not by any means demonstrate all the techniques you 
  31. ;    need for a large application. In particular, Sample does not 
  32. ;    cover exception handling, multiple windows/documents, 
  33. ;    sophisticated memory management, printing, or undo. All of 
  34. ;    these are vital parts of a normal full-sized application.
  35. ;
  36. ;    This application is an example of the form of a Macintosh 
  37. ;    application; it is NOT a template. It is NOT intended to be 
  38. ;    used as a foundation for the next world-class, best-selling, 
  39. ;    600K application. A stick figure drawing of the human body may 
  40. ;    be a good example of the form for a painting, but that does not 
  41. ;    mean it should be used as the basis for the next Mona Lisa.
  42. ;
  43. ;    We recommend that you review this program or Sample before 
  44. ;    beginning a new application. Sample is a simple app. which doesn’t 
  45. ;    use TextEdit or the Control Manager.
  46. ;
  47.  
  48. ;
  49. ;    AsmClikLoop
  50. ;
  51. ;    This routine gets called by the TextEdit Manager from TEClick.
  52. ;    It calls the old, default click loop routine that scrolls the
  53. ;    text, and then calls our own Pascal routine that handles
  54. ;    tracking the scroll bars to follow along.  It doesn't bother
  55. ;    with saving registers A0 and D0, because they are trashed
  56. ;    anyway by TextEdit.
  57. ;
  58.  
  59. AsmClikLoop    PROC        EXPORT
  60.  
  61.             IMPORT        GETOLDCLIKLOOP
  62.             IMPORT        PASCALCLIKLOOP
  63.             
  64.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  65.             CLR.L        -(SP)                ; make space for procedure pointer
  66.             JSR            GETOLDCLIKLOOP        ; get the old clikLoop
  67.             MOVEA.L        (SP)+,A0            ; into A0
  68.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  69.             
  70.             JSR            (A0)                ; and execute old clikLoop
  71.  
  72.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  73.             JSR            PASCALCLIKLOOP        ; do our clikLoop
  74.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  75.             MOVEQ        #1,D0                ; clear the zero flag so TextEdit keeps going
  76.             RTS
  77.  
  78.             END 
  79.  
  80.